<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.oddTd{
		background: #ddd;
	}
</style>
</head>
<body>
	<c:set var="ctx" value="${pageContext.request.contextPath}" />

	<a href="${ctx }/AddEmployee">添加员工</a>
	<table border="1px solid black">
		<thead>
			<tr>
				<td>序号</td>
				<td>姓名</td>
				<td>年龄</td>
				<td>薪资</td>
				<td>入职日期</td>
				<td>操作</td>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${list}" var="emp" varStatus="stat">
				<tr class="<c:if test="${stat.count%2==1}">oddTd</c:if>">
					<td>${stat.count}</td>
					<td>${emp.name }</td>
					<td>${emp.age }</td>
					<td>${emp.salary }</td>
					<%-- <td>${emp.hireDate }</td> --%>
					<td><fmt:formatDate value="${emp.hireDate }" pattern="yyyy-MM-dd"/></td>
					<td><a href="${ctx }/UpdateEmployee?id=${emp.id }">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a
						href="${ctx }/DelEmployee?id=${emp.id }">删除</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</body>
</html>